package com.chinairi.mall.dao;

import com.chinairi.mall.controller.viewobject.GoodsInfoVO;
import com.chinairi.mall.controller.viewobject.ProjectPlanPurchaseVO;
import com.chinairi.mall.model.ProjectPlanPurchase;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chinairi.mall.model.ProjectPlanReqDetail;
import com.chinairi.mall.model.UserCompanyInfo;
import com.chinairi.mall.service.modelobject.CompShopMO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author gsl
 * @since 2020-10-29
 */
public interface ProjectPlanPurchaseMapper extends BaseMapper<ProjectPlanPurchase> {


    /**
     * 绑定需求详情和采购计划
     *
     * @param projectPlanReqDetailList
     */
    void batchUpdateReqDetail(@Param("projectPlanReqDetailList") List<ProjectPlanReqDetail> projectPlanReqDetailList);

    /**
     * 返回采购计划中按供应商排行
     *
     * @param planPurchaseId
     * @return
     */
    List<CompShopMO> getShopRankList(@Param("planPurchaseId") String planPurchaseId);

    /**
     * 获取某一店铺下的可提供物料
     * @param goodsDbidList
     * @return
     * @
     */
    List<GoodsInfoVO> getCollectByShop(@Param("goodsDbidList") List<String> goodsDbidList);

    /**
     * 获取服务商下拉框
     * @param serviceType
     * @return
     */
    List<UserCompanyInfo> selectServerCompByType(@Param("serviceType") String serviceType);

    /**
     * 获取用户的所有采购计划
     * @param userId
     * @return
     */
    List<ProjectPlanPurchaseVO> selectByUserId(@Param("userId") String userId,@Param("uciCompCharacter") Integer uciCompCharacter,@Param("userIds") List<String> userIds);

    /**
     * 流水号
     * @return
     */
    int getPlanPurchaseNo();

    /**
     * 获取当前用户的子级用户id
     * @param userId
     * @return
     */
    List<String> getChildUserIds(String userId);
}
